package foo;


public class EnumsBox {

	interface Named {
		String name();

		int order();
	}

	enum Planets implements Named {
		MERCURY, VENUS, EARTH, MARS;

		public int order() {
			return ordinal() + 1;
		}
	}

	enum Operations {
		PLUS {
			@Override
			double eval(final double x, final double y) {
				return x + y;
			}
		};

		abstract double eval(final double x, final double y);
	}

	public static void main(final String[] args) {
		System.out.println(Planets.EARTH);
		System.out.println(Planets.EARTH.order());

		System.out.println(Operations.PLUS.eval(10, 10));
	}
}
